<template>
  <layout title="我的">
    <view class="index">
      <nut-button type="primary" @click="onLogin">登陆3</nut-button>
      <div v-if="userInfo">
        <nut-avatar size="large" :icon="userInfo.avatar" ></nut-avatar>
        <span>{{userInfo.nickname||''}}</span>
      </div>
    </view>
  </layout>
</template>

<script lang="ts" setup>
import { computed } from 'vue'
import { wechatLogin } from '@/hooks/useLogin'
import { useGetters } from '@/hooks/useStore'
const userInfo = computed(() => useGetters('userInfo'))
// const userInfo = useGetters('userInfo')
console.log("setup",userInfo)
const onLogin = ()=>{
  return wechatLogin();
}
</script>

<script lang="ts">
export default {
  onLoad(options){
    console.log("onLoad",this,options)
  },
  onShareAppMessage(res){
    console.log("测试分享",res)
  }
}
</script>



<style lang="scss">
.index {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
}
</style>
